/*  1:   */ package org.intellij.plugins.relaxNG;
/*  2:   */ 
/*  3:   */

import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.AbstractElementManipulator;
import com.intellij.psi.PsiManager;
import com.intellij.util.IncorrectOperationException;
import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
import org.intellij.plugins.relaxNG.compact.psi.RncFileReference;
import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
import org.jetbrains.annotations.NotNull;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */ 
/* 13:   */ public class RncFileReferenceManipulator
/* 14:   */   extends AbstractElementManipulator<RncFileReference>
/* 15:   */ {
/* 16:   */   public RncFileReference handleContentChange(@NotNull RncFileReference paramRncFileReference, @NotNull TextRange paramTextRange, String paramString)
/* 17:   */     throws IncorrectOperationException
/* 18:   */   {
/* 19:35 */     if (paramRncFileReference == null) {
/* 20:35 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/RncFileReferenceManipulator", "handleContentChange" }));
/* 21:   */     }
/* 22:35 */     if (paramTextRange == null) {
/* 23:35 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/plugins/relaxNG/RncFileReferenceManipulator", "handleContentChange" }));
/* 24:   */     }
/* 25:35 */     ASTNode localASTNode1 = paramRncFileReference.getNode();
/* 26:36 */     assert (localASTNode1 != null);
/* 27:   */     
/* 28:38 */     ASTNode localASTNode2 = localASTNode1.findChildByType(RncTokenTypes.LITERAL);
/* 29:39 */     if (localASTNode2 != null)
/* 30:   */     {
/* 31:40 */       assert (paramTextRange.equals(paramRncFileReference.getReferenceRange()));
/* 32:41 */       PsiManager localPsiManager = paramRncFileReference.getManager();
/* 33:42 */       ASTNode localASTNode3 = RenameUtil.createLiteralNode(localPsiManager, paramString);
/* 34:43 */       localASTNode2.getTreeParent().replaceChild(localASTNode2, localASTNode3);
/* 35:   */     }
/* 36:45 */     return paramRncFileReference;
/* 37:   */   }
/* 38:   */   
/* 39:   */   @NotNull
/* 40:   */   public TextRange getRangeInElement(@NotNull RncFileReference paramRncFileReference)
/* 41:   */   {
/* 42:51 */     if (paramRncFileReference == null) {
/* 43:51 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/RncFileReferenceManipulator", "getRangeInElement" }));
/* 44:   */     }
/* 45:51 */     TextRange tmp46_41 = paramRncFileReference.getReferenceRange();
/* 46:51 */     if (tmp46_41 == null) {
/* 47:51 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/RncFileReferenceManipulator", "getRangeInElement" }));
/* 48:   */     }
/* 49:51 */     return tmp46_41;
/* 50:   */   }
/* 51:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.RncFileReferenceManipulator

 * JD-Core Version:    0.7.0.1

 */